package com.qfedu.springboot1.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/10/31 09:26
 * @Modified:
 */
@RestController
@RequestMapping("/api/hello")
@Tag(name="第一个接口") //为类添加说明
public class HelloController {
    @Operation(summary = "幸运数字") //为映射方法添加说明
    @GetMapping("lucknum")
    public String getLuck(){
        return "亲，你的幸运数字是"+new Random().nextInt(10);
    }
}
